<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    function fn(){
        var arr=[]
        var num =parseInt(Math.random()*100000)
        var str = String(num)
        alert("生成的数是"+num)
        for(var i=0;i<str.length;i++){
            arr.push(str[i])
        }
        for(var i=0;i<arr.length;i++){
            alert("每个数分别是"+arr[i])
        }
       
    }
    fn()
</script>